.PHONY: all build test clean server client

# 默认目标
all: build

# 构建所有目标
build: server client

# 构建服务器
server:
	@echo "构建 SMTP 服务器..."
	@go build -o bin/smtp-server cmd/server/main.go

# 构建客户端
client:
	@echo "构建 SMTP 客户端..."
	@go build -o bin/smtp-client cmd/client/main.go

# 运行测试
test:
	@echo "运行测试..."
	@go test -v ./...

# 清理构建产物
clean:
	@echo "清理构建产物..."
	@rm -rf bin/
	@go clean

# 安装依赖
deps:
	@echo "安装依赖..."
	@go mod download
	@go mod tidy

# 帮助信息
help:
	@echo "可用的命令:"
	@echo "  make build    - 构建所有目标"
	@echo "  make server   - 构建服务器"
	@echo "  make client   - 构建客户端"
	@echo "  make test     - 运行测试"
	@echo "  make clean    - 清理构建产物"
	@echo "  make deps     - 安装依赖" 